<template>
  <div class="box">
    <!-- 导航 -->
    <div class="title">
      <div class="title_fan">
        <span class="el-icon-arrow-left"
              @click="$router.go(-1)"></span>{{$t('My Points Activity')}}
      </div>
      <!-- 查询 -->
      <div class="consume_input">
        <input type=""
               class="iconfont"
               :placeholder="icon"/>
      </div>
      <div class="title_back_img">
        <div>{{$t('Available Points')}}</div>
        <div class="title_back_img_flex">
          <img src="../../../../assets/static/pointsLog/6.png" alt="">
          <div>{{ user_core }}</div>
        </div>
        <div class="title_back_img_flex">
          <div>2020年10月</div>
          <div class="el-icon-arrow-down"></div>
        </div>
        <div>{{ $t('Points Paid') }}:{{ income_score }} {{ $t('Points Earned') }}:{{ pay_score }}</div>
      </div>
    </div>
    <!--  -->
    <div class="card_list">
      <div v-for="item in dataList"
           :key="item.ROW_NUMBER">
        <div class="crad_list_div_flex">
          <img src="../../../../assets/static/pointsLog/3.png" alt="">
          <div>
            <div>{{ item.status === '1' ? '收入' : '支出' }}</div>
            <div>{{ item.create_time }}</div>
          </div>
        </div>
        <div>{{ item.score }}</div>
      </div>
    </div>
  </div>
</template>

<script>
import {scoreLog} from '@/api/merbership/member'

export default {
  data() {
    return {
      icon: '\ue630 搜索',
      dataList: [{
        'id': '1',
        'status': '1',
        'score': '+500',
        'create_time': '2021-10-27 18:56:04',
        'content': '充值',
        'user_id': '1',
        'ROW_NUMBER': '1'
      }],
      user_core: '',
      income_score: '',
      pay_score: ''
    }
  },
  activated() {
    this.scoreLog()
  },
  methods: {
    /**
     * 积分记录
     */
    scoreLog() {
      const pd = {}
      scoreLog(pd)
        .then(res => {
          this.dataList = res.data.data.list
          this.user_core = res.data.data.user_core
          this.income_score = res.data.data.income_score
          this.pay_score = res.data.data.pay_score
        })
    }
  }
}
</script>

<style lang="scss" scoped>
.box {
  .title {
    background-image: linear-gradient(to bottom, #7AC91B 50%, #f5f5f5 0);

    .title_fan {
      color: #fff;
      font-size: 18px;
      text-align: center;
      padding: 15px;

      .el-icon-arrow-left {
        float: left;
        margin-top: 5px;
      }
    }


    /* 输入框 */
    .consume_input {
      margin: 0 15px;

      input {
        box-shadow: 0 0 5px #ccc;
        width: 98%;
        text-align: center;
        outline: none;
        border: none;
        height: 40px;
        border-radius: 10px;
      }

      input::-webkit-input-placeholder {
        color: #67C41D;
      }
    }

    .title_back_img {
      margin: 15px;
      background-color: #fff;
      padding: 22px;
      border-radius: 10px;
      box-shadow: 0 5px 10px #ccc;

      .title_back_img_flex {
        display: flex;
        align-items: center;
      }

      > div:nth-child(1) {
        color: #999999;
        font-size: 12px;
        text-align: center;
      }

      > div:nth-child(2) {
        justify-content: center;
        margin: 10px 0 20px 0;
        font-size: 21px;
        font-weight: bold;

        img {
          margin-right: 5px;
          width: 21px;
          height: 21px;
        }
      }

      > div:nth-child(3) {
        justify-content: space-between;
        background-color: #63BD1F;
        padding: 10px;
        border-radius: 10px;
        font-size: 12px;
        color: #FFFFFF;
      }

      > div:nth-child(4) {
        font-size: 12px;
        font-weight: bold;
        color: #FEC200;
        text-align: center;
        margin-top: 20px;
      }
    }
  }

  .card_list {
    margin: 15px;

    > div {
      margin: 12px 0;
      display: flex;
      justify-content: space-between;
      align-items: center;
      background-color: #fff;
      border-radius: 8px;
      box-shadow: 0 0 10px #ccc;
      padding: 10px;
      color: #63BD1F;
      font-size: 18px;
      font-weight: bold;

      .crad_list_div_flex {
        display: flex;

        > div {
          margin-left: 10px;
          display: flex;
          flex-wrap: wrap;
          align-items: center;

          > div {
            width: 100%;
          }

          > div:nth-child(1) {
            font-size: 13px;
            color: #333;
          }

          > div:nth-child(2) {
            font-size: 11px;
            color: #999;
            font-weight: normal;
          }
        }
      }
    }
  }
}
</style>
